package com.rc.saas.tenant.service.platform;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.rc.saas.tenant.mapper.platform.PlatformCarBrandMapper;
import com.rc.saas.tenant.model.platform.PlatformCarBrand;
import com.rc.saas.tenant.model.platform.PlatformCarBrandExample;
import com.rc.saas.tenant.search.platform.PlatformCarBrandSearch;
import com.rc.saas.tenant.vo.platform.PlatformCarBrandVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by sven on 2018-04-17
 */
@Service
public class PlatformCarBrandServiceImpl implements PlatformCarBrandService {
    @Autowired
    private PlatformCarBrandMapper platformCarBrandMapper;

    @Override
    public PlatformCarBrandMapper getMapper() {
        return platformCarBrandMapper;
    }

    @Override
    public PageInfo<PlatformCarBrand> listPageByCondition(PlatformCarBrandSearch PlatformCarBrandSearch) {
        PageHelper.startPage(PlatformCarBrandSearch.getOffset(), PlatformCarBrandSearch.getLimit());
        List<PlatformCarBrand> elecLabelList =  platformCarBrandMapper.listPageByCondition(PlatformCarBrandSearch);
        return new PageInfo<PlatformCarBrand>(elecLabelList);
    }

    /**
     * 查询所有车牌
     * @return
     */
    @Override
    public List<PlatformCarBrand> selectCarBrand() {
        return platformCarBrandMapper.selectByExample(new PlatformCarBrandExample());
    }
}
